<?php
/**
 * 
 * @Author: kulou $
 * @Date: ArticleController.class.php 2015/5/11 9:53 $
 */

class ArticleController extends Controller {

    public function __construct(){
        $this->_assign('config',C());
    }

    public function index(){
        $id = intval($_GET['id']);
        if($id <= 0) {
            $this->error("参数错误!");
        }
        $model = new NewsModel();
        $artInfo = $model->oneData($id);

        $title = $artInfo['d_title'];
        $content = $artInfo['d_content'];
        $author = $artInfo['d_author'];
        $date = $artInfo['d_adddate'];

        $this->_assign('title', $title);
        $this->_assign('content', $content);
        $this->_assign('author', $author);
        $this->_assign('date', $date);

        $this->_display('article_index');
    }
} 